var $ = getApp(), methods = require("../methods.js");
Page(Object.assign({},methods,{
	data: {
	},
	_onLoad: function () {
		var that = this;
		var id = 0;
		if (that.options && that.options.id) {
			id = that.options.id
		}
		if (that.options && that.options.scene) {
			var scene = that.options.scene
			var scenes = scene.split('_');
			if(scenes[1]){
				id = parseInt(scenes[1]);
			}
		}
		wx.setNavigationBarTitle({
			title: (that.data.textset['优惠券'] || '优惠券')+'详情'
		});
		$.get('coupon/coupondetail', {rid:that.options.rid,id:id}, function (res) {
			that.setData(res)
		});
	}
}))